using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using IGlobalist.Cms.Common;
using IGlobalist.Cms.Bll;
using IGlobalist.Cms.Model;
using System.Collections.Generic;

namespace IGlobalist.Cms.Admin
{
    public partial class UserManagement : AdminBasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                IList<ICmsClass> cList = ClassController.GetClassListByClassTypeID((short)CmsObjectType.User);
                ucClassList.DataSource = cList;
                ucClassList.DataBind();
                ucActionBar.ObjectTypeCurrent = CmsObjectType.User;
                ucActionBarBottom.ObjectTypeCurrent = CmsObjectType.User;
            }
            ucActionBar.DeleteButtonClick += ucUserList.DoDelete;
            ucActionBar.DeleteButtonClick += ucUserList.DoShow;
            ucActionBar.DeleteButtonClick += ucUserAddEdit.DoHidden;
            ucActionBarBottom.DeleteButtonClick += ucUserList.DoDelete;
            ucActionBarBottom.DeleteButtonClick += ucUserList.DoShow;
            ucActionBarBottom.DeleteButtonClick += ucUserAddEdit.DoHidden;

            ucActionBar.SaveButtonClick += ucUserAddEdit.DoSave;
            ucActionBarBottom.SaveButtonClick += ucUserAddEdit.DoSave;
            ucUserAddEdit.SaveUser += ucUserList.DoShow;
            ucUserAddEdit.SaveUser += ucUserAddEdit.DoHidden;

            ucActionBar.CopyButtonClick += ucUserAddEdit.DoCopy;
            ucActionBar.CopyButtonClick += ucUserList.DoHidden;
            ucActionBar.CopyButtonClick += ucUserAddEdit.DoShow;
            ucActionBarBottom.CopyButtonClick += ucUserAddEdit.DoCopy;
            ucActionBarBottom.CopyButtonClick += ucUserList.DoHidden;
            ucActionBarBottom.CopyButtonClick += ucUserAddEdit.DoShow;

            ucClassList.TreeNodeClick += ucUserList.DoBindUser;
            ucClassList.TreeNodeClick += ucUserList.DoShow;
            ucClassList.TreeNodeClick += ucUserAddEdit.DoHidden;
            ucClassList.TreeNodeClick += HiddenInfo;


            ucActionBar.NewButtonClick += ucUserAddEdit.DoNew;
            ucActionBar.NewButtonClick += ucUserList.DoHidden;
            ucActionBar.NewButtonClick += ucUserAddEdit.DoShow;
            ucActionBar.NewButtonClick += HiddenInfo;
            ucActionBarBottom.NewButtonClick += ucUserAddEdit.DoNew;
            ucActionBarBottom.NewButtonClick += ucUserList.DoHidden;
            ucActionBarBottom.NewButtonClick += ucUserAddEdit.DoShow;
            ucActionBarBottom.NewButtonClick += HiddenInfo;
            ucActionBarBottom.NewButtonClick += ucActionBar.DoEditClassClick;
            ucActionBar.NewButtonClick += ucActionBarBottom.DoEditClassClick;


            ucUserList.EditUser += ucUserAddEdit.DoEditPage;
            ucUserList.EditUser += ucUserList.DoHidden;
            ucUserList.EditUser += ucUserAddEdit.DoShow;
            ucUserList.EditUser += ucActionBarBottom.DoEditClassClick;
            ucUserList.EditUser += ucActionBar.DoEditClassClick;


            ucClassList.TreeNodeClick += ucActionBar.DoViewClick;
            ucClassList.TreeNodeClick += ucActionBarBottom.DoViewClick;
            ucUserAddEdit.SaveUser += ucActionBar.DoViewClick;
            ucUserAddEdit.SaveUser += ucActionBarBottom.DoViewClick;

           
            
        }
        public void HiddenInfo(object sender, EventArgs e)
        {
            pnlInfo.Visible = false;
        }
       
    }
}
